package com.gurun.camera.account.model;

import android.util.Log;

import com.danale.sdk.Danale;
import com.danale.sdk.platform.constant.countrycode.Language;
import com.danale.sdk.platform.result.countrycode.CountryCodeResult;

import java.util.Locale;

import rx.Observable;

/**
 * Created by danal on 2016/9/9.
 */

public class ObtainCountryModelImpl implements IObtainCountryModel {

    @Override
    public Observable<CountryCodeResult> obtainCurrentCountry() {

        return Danale.get().getLocaitonService().getCountryCodes(1, Language.ENGLISH);
    }

    @Override
    public Observable<CountryCodeResult> obtainCountryCodelist() {

        Log.e("LANGUAGE", Locale.getDefault().getLanguage());

        if(Locale.getDefault().getLanguage().equals("zh")){
            return Danale.get().getLocaitonService().getCountryCodes(1, Language.CHINESE);
        }

        return Danale.get().getLocaitonService().getCountryCodes(1, Language.ENGLISH);

    }


}
